package top.zhangjianyong.blog.params.menu;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

/**
 * 菜单新增修改参数
 *
 * @author zhangjianyong
 * @since 2024/7/23 下午5:45
 */
public record MenuSaveOrUpdateParam(
    Long id,
    Long pid,
    @NotBlank(message = "菜单标题不能为空") String title,
    String path,
    String icon,
    @NotNull(message = "排序不能为空") Integer sort) {
  public MenuSaveOrUpdateParam {
    if (pid == null) {
      pid = 0L;
    }
  }
}
